#include <iostream>
#include "../Util/Compresor/Compresor.h"
#include "../Util/Compresor/Arithmetic/Dynamic/DynamicArithmeticCompresor.h"
#include "../Util/Compresor/Arithmetic/Dynamic/DynamicArithmeticDescompresor.h"

using namespace std;

class TestCompressor {

	Compresor *compressor;
	Compresor *descompresor;

public:

	void Setup() {
		this->compressor = new DynamicArithmeticCompresor();
		this->descompresor =  new DynamicArithmeticDescompresor();
	}

	void Terminar() {
		delete this->compressor;
		cout << "El test de TestCompressor se completó" << endl;
	}

	void compressSomething(){
					string palabra = "POR FIN ANDA EL COMPRESOR Y DESCOMPRESOR éñopñQUE ALEGRIA INMENSA!!!";
					cout<< "cadena a comprimir: "<<palabra<<endl;
	               this->compressor->setStringToCompress(palabra);
	               string compressedString = this->compressor->doCompress();
	               cout << "Cadena Comprimida: " << compressedString << endl;

	               this->descompresor->setStringToUncompress(compressedString);
	               string decompressedString = this->descompresor->doUncompress();

	               cout<<"Cadena Descomprimida: "<<decompressedString<<endl;



    }

	void Run() {
		Setup();
		compressSomething();
		Terminar();
	}

};
